@import "../base/colors.less";
@import "../base/spacing.less";
@import "./inputs";

.popup-wrapper {
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  z-index: 6000;
  background: rgba(0,0,0,.45);
  font-style: normal;
  overflow-y: auto;
}

.popup-inner {
  background: #fff;
  box-shadow: 0 2px 25px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(0,0,0,0.55);
  border-radius: 4px;
  width: 450px;
  margin: 80px auto 0;
  overflow: hidden;

  .error {
    color: darken(@red, 17%) !important;
    margin: 10px 0 !important;
    font-style: italic;
  }

  .head {
    position: relative;
    background: #fafafa;
    padding: 7px 12px;
    width: 100%;
    border-bottom: 1px solid #eee;
    border-radius: 4px 4px 0 0;

    .title {
      font-size: .95rem;
      font-weight: 500;
    }

    .close-btn {
      position: absolute;
      top: 10px;
      right: 12px;
    }
  }

  .body {
    padding: 12px;

    > div:not(:first-child) {
      margin-top: 20px;
    }
  }

  p {

    &:first-child {
      margin-top: 0;
    }

    &:last-child {
      margin-bottom: 0;
    }
  }

  select {
    height: 28px;
  }

  textarea,
  label:not(.checkbox-container),
  select,
  input {
    display: block;
    width: 100%;
  }

  label.toggle {
    display: flex;
    justify-content: flex-end;

    .text {
      margin-right: 10px;
    }

    input {
      display: none;
    }
  }

  label {
    margin-bottom: 3px;
    color: fadeout(@color-text, 10%);
  }

  textarea,
  input {
    margin-bottom: 10px;
  }

  textarea {
    height: 50px;
    padding-top: 3px;
  }

  .actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid #eee;

    .left,
    .link {
      margin-right: auto;
    }

    .btn,
    .success,
    .primary {
      margin-left: 5px;
    }

    .spinner {
      width: 10px;
      height: 10px;
      border-width: 1.2px;
    }
  }
}

#share-popup {

  .popup-inner {

    div {
      margin: @padding-component--tight 0;
      line-height: 1;
    }

    input {
      &:extend(.code-font);
      &:extend(input.roomy);
      color: @color-text;
      width: 100%;
      margin-top: @padding-component--tight;
      font-size: .85rem;

      &:focus {
        outline: none;
      }
    }

    .btn {
      float: right;
    }

    .info {
      margin: @padding-component--tight 0;
      color: @color-text--muted;
      font-size: .8rem;

      i {
        margin-right: 3px;
      }
    }
  }
}

#crop-popup {

  .popup-inner {
    width: 298px;

    .controls {
      width: 256px;
      margin: 1rem 0 0;
    }

    canvas {
      display: block;
      border: 1px solid gray;
      border-radius: 50%;
    }

    input[type="range"] {
      width: 256px;
    }

    .btns {
      text-align: right;
    }
  }
}

#create-workspace-popup {

  .btn.url {
    position: relative;
    overflow: visible;

    &:after {
      &:extend(.code-font);
      position: absolute;
      left: ~"calc(100% + 10px)";
      top: 0;
      content: attr(data-url);
      font-size: 13px;
      color: inherit;
    }
  }

  label:not(:first-child) {
    margin-top: 25px;
  }

  p {
    font-style: italic;
    color: @color-text--muted;
    margin-top: 5px;
  }

  .separator {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    grid-gap: 15px;
    align-items: center;
    text-align: center;
    text-transform: uppercase;
    font-weight: 500;
    font-size: 12px;
    color: @color-text--muted;
    margin: 20px 0;

    &:before,
    &:after {
      content: '';
      height: 1px;
      background: #ddd;
    }
  }
}

#add-pinned-bookmark-popup {

  .popup-inner {
    // allow the suggested bookmark results to overflow the element
    overflow: visible;
  }

  .autocomplete-results {
    top: 33px;
  }
}

#library-localsyncpath-popup {

  .popup-inner {
    width: 530px;
    overflow: initial;
  }

  .path-container {
    &:extend(.flex);
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 28px;
    border: 1px solid #ddd;
    border-radius: 4px 2px 2px 4px;

    .btn {
      border: 0;
      border-left: 1px solid #ddd;
      height: 26px;
    }

    .path {
      &:extend(.code-font);
      flex: 1;
      height: 100%;
      line-height: 28px;
      padding: 0 7px;
      margin: 0;
      border: 0;
    }
  }
  
  .message {
    margin-top: 10px;
  }
}

#library-copydat-popup {

  strong {
    font-weight: 600;
  }

  .downloader {
    .download-desc {
      font-size: 12px;
      margin-top: 3px;
      color: @color-text--muted;
      text-align: center;
    }
  }
}

#library-deletedraft-popup {

  .fa-check {
    color: shade(@green, 15%);
    -webkit-text-stroke: .5px #fff;
  }
}